﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DapperDemo
{
  public class Context
  {
      private static readonly string sqlConnection = ConfigurationManager.ConnectionStrings["PlatformConnection"].ToString();

      public static IDbConnection GetConnection()
      {
          SqlConnection con = new SqlConnection(sqlConnection);

          if (con.State == ConnectionState.Closed)
          {
              con.Open();
          }
          return con;
        }
  }
}
